{{extend 'layout.html'}}

<h2 class="fancy">PyForum - Edit Forum Properties</h2>

{{include 'fadmin/admin_options.html'}}

{{include 'default/err_check.html'}}

<form id="update_forum_form" method="post" action="">
<fieldset id="update_forum_form_fields">
    <input type="hidden" id="form_submitted" name="form_submitted" value="1" />
    <input type="hidden" id="form_id" name="forum_id" value="{{=this_forum.id}}" />
    <table cellspacing="2" cellpadding="2">
    <tbody>
        <tr>
            <td><span class="warning">[*]</span> Forum Name:</td>
            <td><input type="text" id="title" name="title" value="{{=request.vars.get('title', this_forum.forum_title)}}" style="width:400px;" /></td>
        </tr>
        <tr>
            <td><span class="warning">[*]</span> Forum Description:</td>
            <td><textarea id="description" name="description" rows="0" cols="0" style="width:400px;height:150px;">{{=request.vars.get('description', this_forum.forum_desc)}}</textarea></td>
        </tr>
        <tr>
            <td>Select Category:</td>
            <td>
                <select id="new_cat_id" name="new_cat_id">
                    {{for sel_cat in cats:}}
                        <option value="{{=sel_cat.id}}"
                                    {{if this_forum.cat_id==sel_cat.id:}}
                                        selected="selected"{{pass}}>
                                        {{=sel_cat.cat_name}}</option>
                    {{pass}}
                </select>
            </td>
        </tr>
        <tr>
            <td><label for="moderated_forum">Forum is Moderated:</label></td>
            <td><input type="checkbox" id="moderated_forum" name="moderated_forum"
                {{if request.vars.get('moderated_forum', this_forum.moderation_flag):}}checked="checked"{{pass}} /></td>
        </tr>
        <tr>
            <td><label for="anonymous_view">Anonymous users can browse forum:</label></td>
            <td><input type="checkbox" id="anonymous_view" name="anonymous_view"
                {{if request.vars.get('anonymous_view', this_forum.anonymous_viewaccess):}}checked="checked"{{pass}} /></td>
        </tr>
        <tr><td colspan="2"><div class="hr"><hr /></div></td></tr>
        <tr>
            <td style="vertical-align:top;">Allow Topic Creation To:</td>
            <td style="vertical-align:top;">
                <select id="auth_topic_creation_roles" name="auth_topic_creation_roles">
                    <option {{if request.vars.get('auth_topic_creation_roles', this_forum.add_postings_access_roles) == forum_memberships['FORUM_ADMINISTRATOR']:}}selected="selected"{{pass}}
                            value="{{=forum_memberships['FORUM_ADMINISTRATOR']}}">Forum Administrators</option>
                    <option {{if request.vars.get('auth_topic_creation_roles', this_forum.add_postings_access_roles) == '':}}selected="selected"{{pass}}
                            value="">Public</option>
                    <option {{if request.vars.get('auth_topic_creation_roles', this_forum.add_postings_access_roles) == '%s,%s' % (forum_memberships['FORUM_ADMINISTRATOR'], forum_memberships['FORUM_MEMBER']):}}selected="selected"{{pass}}
                            value="{{=forum_memberships['FORUM_ADMINISTRATOR']}},{{=forum_memberships['FORUM_MEMBER']}}">Regular Forum Members (+Admins)</option>
                </select>
            </td>
        </tr>
        <tr>
            <td style="vertical-align:top;">Allow Topic Replies To:</td>
            <td style="vertical-align:top;">
                <select id="auth_topic_replies_roles" name="auth_topic_replies_roles">
                    <option {{if request.vars.get('auth_topic_replies_roles', this_forum.reply_postings_access_roles) == forum_memberships['FORUM_ADMINISTRATOR']:}}selected="selected"{{pass}}
                            value="{{=forum_memberships['FORUM_ADMINISTRATOR']}}">Forum Administrators</option>
                    <option {{if request.vars.get('auth_topic_replies_roles', this_forum.reply_postings_access_roles) == '':}}selected="selected"{{pass}}
                            value="">Public</option>
                    <option {{if request.vars.get('auth_topic_replies_roles', this_forum.reply_postings_access_roles) == '%s,%s' % (forum_memberships['FORUM_ADMINISTRATOR'], forum_memberships['FORUM_MEMBER']):}}selected="selected"{{pass}}
                            value="{{=forum_memberships['FORUM_ADMINISTRATOR']}},{{=forum_memberships['FORUM_MEMBER']}}">Regular Forum Members (+Admins)</option>
                </select>
            </td>
        </tr>
        <tr><td colspan="2"><div class="hr"><hr /></div></td></tr>
        <tr>
            <td><label for="latest_topics">Allow topics in "Latest Topics" section:</label></td>
            <td><input type="checkbox" id="latest_topics" name="latest_topics"
                {{if request.vars.get('latest_topics', this_forum.include_latest_topics):}}checked="checked"{{pass}} /></td>
        </tr>
    </tbody>
    </table>
    <div class="top-separator">
        <input type="submit" id="submit" name="update_forum" value="Update" />
        <input type="submit" id="cancel" name="cancel" value="Cancel" />
    </div>
</fieldset>
</form>
